/**
 * 
 */
package com.bitantenna.player;

import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;

public final class PlayerDetailsListener implements ActionListener {
	private final Player player;

	public PlayerDetailsListener(Player player) {
		this.player = player;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		player.getPanel_detail().setVisible(!player.getPanel_detail().isVisible());
		Container c=player.getTopLevelAncestor();
		//System.out.println(player.getPreferredSize());
		if (c instanceof JFrame) ((JFrame)c).pack();
	}
}